package com.xxx.auth.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Comment;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@MappedSuperclass
public class TimeEntity {
    @Column
    @CreatedDate
    @Comment("创建时间")
    @Schema(title = "创建时间")
    private Date createdDate;

    @Column
    @LastModifiedDate
    @Comment("更新时间")
    @Schema(title = "更新时间")
    private Date lastModifiedDate;
}
